package com.jiangruan.javaApiProject.service;

import com.alibaba.fastjson.JSONObject;
import com.jiangruan.javaApiProject.Constants;
import com.jiangruan.javaApiProject.bean.bean.CarPersonCommon;
import com.jiangruan.javaApiProject.net.HttpUtils;

import java.util.List;

/**
 * @Author 默
 * @Date 16:08 2021/12/8
 * @desc
 * @Description
 */
public class CarPersonService {
    public static List<CarPersonCommon> getCarPerson() {

        String url = Constants.TRIP_URL
                + "?key=" + Constants.TRIP_KEY
                + "&type=car_overall"
                + "&size=0";

        String result = HttpUtils.get(url);
        //对汽车达人数据进行JSON
        CarPersonCommon carPersonCommon = JSONObject.parseObject(result, CarPersonCommon.class);


        return carPersonCommon.result;
    }
    }
